package com.junit;

import static org.junit.Assert.*;

import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.util.Hashtable;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.JUnitCore;

public class MyMathTest
{
	MyMath math;
	
	@Before
	public void setUp() throws Exception
	{
		math = new MyMath();
		
	}

	@After
	public void tearDown() throws Exception
	{
		math = null;
	}

	@Test
	public void testOneEquation()
	{
		System.out.println("testOneEquation");
		
		assertEquals(math.oneEquation(5, 9), -1.8, .00001);
		assertEquals(math.oneEquation(0, 9), -1);
		fail("Not yet implemented");
	}
	
	@Test
	public void testTwoEquation()
	{
		System.out.println("testTwoEquation");
		
		double[] tmp = math.twoEquation(1, -3, 2);
		
		assertEquals("1 wrong", tmp[0], 2, .00001);
		assertEquals("2 wrong", tmp[1], 3, .00001);
	}
	
	public static void main(String[] args)
	{
		JUnitCore.main("com.junit.MyMathTest");
	}

}
